home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
L' Effet Pommier 3
/
L'Effet Pommier - Volume 03.iso
/
Programmation
/
Alpha ƒ
/
Tcl
/
SystemCode
/
paths.tcl
< prev
next >
Wrap
Text File
|
1996-01-12
|
3KB
|
92 lines
# Any directory must have 'folder' somewhere in the comment.
set pathComments(texPath) "TeX application"
set pathComments(TeXInputs) "TeX Inputs folder"
set pathComments(bibtexPath) "BibTeX"
set pathComments(cdPath) "CodeWarrior Debugger"
set pathSig(cdPath) "cwdSig"
set pathComments(cwPath) "CodeWarrior Compiler"
set pathSig(cwPath) "cwSig"
set pathComments(mailPath) "Eudora Path"
set pathComments(excaliburPath) "Excalibur Spellchecker"
set pathComments(macperlPath) "MacPerl"
set pathComments(perlFilterPath) "MacPerl Text Filters folder"
set pathComments(perlDocs) "MacPerl documentation folder"
set pathComments(perlLib) "MacPerl lib folder"
set pathComments(referencePath) "Think Reference"
set pathComments(tassPath) "Toolbox Assistant"
set pathComments(kodexPath) "Kodex C Pretty Printer"
set pathComments(enscriptorPath) "Enscriptor Fancy Printer"
set pathComments(droppsPath) "DropÑPS"
set pathComments(symPath) "Symantec Project Manager"
set pathComments(symDbgPath) "Symantec Debugger"
set tmp {}
foreach n [array names pathComments] {
lappend tmp $pathComments($n)
}
menu -n appPaths -m -p pathProc [lsort $tmp]
unset tmp
#===============================================================================
proc pathProc {menu comment} {
global pathComments modifiedVars pathSig pathUseIC
foreach path [array names pathComments] {
if {$pathComments($path) == $comment} {
global $path
if {[info exists $path]} {
set buttons {OK Change Remove Launch}
if {[info exists pathUseIC($path)]} {
lappend buttons "IConfig"
}
set val [set $path]
} else {
set buttons {OK Set Remove}
set val {}
}
set res [eval [list buttonAlert "$pathComments($path):\r$val"] $buttons]
switch $res {
"Set" "-"
"Change" { if {[regexp -nocase {.*folder.*} $pathComments($path)]} {
set $path [get_directory -p "Select $pathComments($path):"]
} else {
set $path [getfile "Select $pathComments($path):"]
}
lappend modifiedVars $path
if {[info exists pathSig($path)]} {
global $pathSig($path)
set $pathSig($path) [getFileSig [set $path]]
lappend modifiedVars $pathSig($path)
}
}
"Remove" { set $path {} }
"Launch" { launch -f [set $path] }
"IConfig" {
if {[askyesno "Set '$path' from 'Internet Config'?"] == "yes"} {
if {[catch {icGetPref -t 1 $pathUseIC($path)} npath]} {
alertnote "Internet Config Error (installed?)"
} else {
message $npath
set $path $npath
lappend modifiedVars $path
if {[info exists pathSig($path)]} {
global $pathSig($path)
set $pathSig($path) [getFileSig [set $path]]
lappend modifiedVars $pathSig($path)
}
}
}
}
}
return
}
}
}